/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package memsim.instructions;

/**
 *
 * @author Joe
 * This is a helper class to convert signed numbers to unsigned
 */
public class UnsignedHelper {

    /**
     *
     * @param i  The short that you would like to be unsigned for binary operations
     * @return   The int representation of i in an unsigned format
     */

    public int UnsignedIntFromShort(short i){
        int unsigned;
        unsigned = (int) (i & 0xFFFF);
        return unsigned;
    }
    /**
     *
     * @param 2  The int that you would like to be unsigned for binary operations
     * @return   The long representation of i in an unsigned format
     */
    public long UnsignedLongFromInt(int j){
        long unsigned;
        unsigned = (long) (j & 0xFFFFFFFFL);
        return unsigned;

    }


}
